﻿using Newtonsoft.Json;
using OSSUtility.BLL;
using Ozone.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ozone.BLL
{
    /// <summary>
    /// 配液方法
    /// </summary>
    public class DispensingMethodBLL
    {
        /// <summary>
        /// 查询配液方法
        /// </summary>
        /// <param name="LineNum"></param>
        /// <returns></returns>
        static public DispensingModel getMethodMain(int LineNum)
        {
            string FDataID = "DispensingModel";
            DispensingModel model = null;
            ConfigParamBLL bll = new ConfigParamBLL();
            string FContent = bll.getContent(FDataID);

            if (string.IsNullOrEmpty(FContent))
            {
                model = new DispensingModel();
            }
            else
            {
                model = JsonConvert.DeserializeObject<DispensingModel>(FContent);

            }
            return model;
        }
        /// <summary>
        /// 保存配液方法
        /// </summary>
        /// <param name="model"></param>
        /// <param name="LineNum"></param>
        static public void save(DispensingModel model, int LineNum)
        {
            string FDataID = "DispensingModel";
            ConfigParamBLL bll = new ConfigParamBLL();
            bll.Save(FDataID, JsonConvert.SerializeObject(model));

        }
    }
}
